#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "ElectricSwitchComponent.generated.h"

class URoomSwitchComponent;

UCLASS(Blueprintable, Abstract, ClassGroup =(RoomLight))
class PHOBIA_API UElectricSwitchComponent : public UActorComponent
{
	GENERATED_BODY()

protected:
	virtual void BeginPlay() override;
	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;

private:
	TArray<URoomSwitchComponent*> GetRoomSwitchComponents();

protected:
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "ElectricSwitch")
	int32 MaxPower = 6;

private:
	UPROPERTY(Transient)
	int32 CurrentPower = 0;

	UPROPERTY(Transient)
	TArray<TObjectPtr<URoomSwitchComponent>> RoomSwitchComponents;
};
